﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="H2.NET.Web.Management.MeiPing.Index" %>

<%@ Register src="../../UserControls/Pager.ascx" tagname="Pager" tagprefix="uc1" %>
<%@ Register src="../../UserControls/Toolbar.ascx" tagname="Toolbar" tagprefix="uc1" %>

<form id="pagerForm" onsubmit="return navTabSearch(this);" action="<%= Request.RawUrl %>" method="post">

    <input type="hidden" name="pageNum" value="<%= PageNumber %>" />
    <input type="hidden" name="numPerPage" value="<%= PageSize %>" />

<div class="pageHeader">
	<div class="searchBar">
		<table class="searchContent">
			<tr>
				<td>
					<label>名称：</label><input type="text" name="SerialNumber" size="30" value="<%= SerialNumber %>" />
				</td>
			</tr>
		</table>
		<div class="subBar">
            <span class="info_clear">符合条件的记录，共有 <strong><%= TotalItemCount %></strong>条。</span>
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div></li>
                <li><div class="button"><div class="buttonContent"><button type="reset">重置</button></div></div></li>
			</ul>
		</div>
	</div>
</div>
</form>
<form id="form1" runat="server">
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
		    <uc1:toolbar ID="Toolbar1" runat="server" />
		</ul>
	</div>
	<table class="table" width="100%" layoutH="137">
		<thead>
            <tr>
                <th style="width: 5%;">序号</th>
                <th align="center" style="width:50%;">序列号</th>
                <th align="center" style="width:30%;">使用时间</th>
                <th align="center" style="width:15%;">状态</th>
            </tr>
        </thead>
		<tbody>
        <asp:Repeater ID="rpt_mps" runat="server">
        <ItemTemplate>
            <tr rel='<%# Eval("ID") %>' target="selectedId">
                <td class="fixedcol"><%# Container.ItemIndex + 1%></td>
                <td><%# Eval("SerialNumber")%></td>
                <td><%# Eval("UserDate")%></td>
                <td style="color:<%# Eval("Status").ToString()=="True"?"red":"green"%>"><%# Eval("Status").ToString()=="True"?"已使用":"未使用"%></td>
            </tr> 
        </ItemTemplate>
        </asp:Repeater>
        </tbody>
	</table>

</div>
<uc1:Pager ID="Pager1" runat="server" />
</form>

<script type="text/javascript">
    function MeiPingImport(url, rel, title) {
        $.pdialog.open(url, rel, title, { width: 400, height: 150, mask: true });
        return false;
    }

    function MeiPingCreate(url, rel, title) {
        $.pdialog.open(url, rel, title, { width: 400, height: 200, mask: true });
        return false;
    }
    function MeiPingEdit(url, rel, title) {
        var id = $("#selectedId", navTab.getCurrentPanel()).val();
        if (!id) {
            alertMsg.warn("请先选择一条数据！");
            return false;
        }
        $.pdialog.open(url + "?id=" + id, rel, title, { width: 400, height: 200, mask: true });
        return false;
    }
    function MeiPingDelete(url, rel, title) {
        var id = $("#selectedId", navTab.getCurrentPanel()).val();
        if (!id) {
            alertMsg.warn("请先选择一条数据！");
            return false;
        }
        alertMsg.confirm(title, {
            okCall: function () {
                $.ajax({
                    type: 'POST',
                    url: url,
                    data: { id: id, title: title },
                    dataType: "json",
                    cache: false,
                    success: function (json) {
                        DWZ.ajaxDone(json);
                        navTabSearch($("#pagerForm", navTab.getCurrentPanel()));
                    },
                    error: DWZ.ajaxError
                });
            }
        });
        return false;
    }
</script>
